#include <iostream>

using std::cout;
using std::endl;

//参数类型
//1、T称为类型参数,T可以推导为int、double
//2、非类型参数,都是整型：char/bool/short/int/long/long long/size_t
//(浮点型：float/double)
//模板参数也是可以设置默认值的
template <typename T = int, short kMin = 10>
T multiply(T x, T y)
{
    cout << "T multiply(T, T, short)" << endl;
    return x * y * kMin;
}

void test()
{
    int ia = 3, ib = 4;
    cout << "multiply(ia, ib) = " << multiply<int, 100>(ia, ib) << endl;
    /* cout << "multiply(ia, ib) = " << multiply(ia, ib) << endl; */
}

int main(int argc, char **argv)
{
    test();
    return 0;
}

